//
//  Macro.h
//
//  Copyright (c) 2015年 WorldUnion. All rights reserved.
//



#define kHome_storyVCName(vcName) [[UIStoryboard storyboardWithName:@"Main" bundle:[NSBundle mainBundle]] instantiateViewControllerWithIdentifier:vcName]
#define kMine_storyVCName(vcName)  [[UIStoryboard storyboardWithName:@"Mine" bundle:[NSBundle mainBundle]] instantiateViewControllerWithIdentifier:vcName]
#define kCar_storyVCName(vcName)  [[UIStoryboard storyboardWithName:@"ShoppingCar" bundle:[NSBundle mainBundle]] instantiateViewControllerWithIdentifier:vcName]
#define kPerson_storyVCName(vcName)[[UIStoryboard storyboardWithName:@"Person" bundle:[NSBundle mainBundle]] instantiateViewControllerWithIdentifier:vcName]

//设备屏幕高度
#ifndef UIScreenHeight
#define UIScreenHeight   [UIScreen mainScreen].bounds.size.height
#endif
//设备屏幕宽度
#ifndef UIScreenWidth
#define UIScreenWidth    [UIScreen mainScreen].bounds.size.width
#endif


// 需要跳转到首页
#define NOTIFICATION_GO_HOME @"gotoHome"

// 需要跳转到分类
#define NOTIFICATION_GO_CLASSIFY @"gotoClassify"

// 需要跳转到购物车
#define NOTIFICATION_GO_CAR @"gotoCar"

// 需要跳转到我的
#define NOTIFICATION_GO_MINE @"gotoMine"

#define kDoubleToString(double) [NSString stringWithFormat:@"%.2f",double]
#define kIntToString(int) [NSString stringWithFormat:@"%@",@(int)]
#define kFloatToString(float) [NSString stringWithFormat:@"%.0f",float]
#define kObjToString(obj) [NSString stringWithFormat:@"%@",obj]

#define kPushNav(pushView,bool) [self.navigationController pushViewController:pushView animated:bool]

#define KIsSimulator [[[UIDevice currentDevice] model] hasSuffix:@"Simulator"] //是否是模拟器
#define kToast_Message_NoData_ @"暂无数据"
#define kListPageSize 100
#define kFont(px) [UIFont systemFontOfSize:(px) / 2.0]
#define kFontB(px) [UIFont boldSystemFontOfSize:(px) / 2.0]
#define kMargin (20 / 2.0)

/**
 *  判断一个字符串是否为空
 *
 *  @param string 字符串
 *
 *  @return 返回结果
 */
static inline BOOL IsStringEmpty(NSString *string){
    if (![string isKindOfClass:[NSString class]]) {
        return YES;
    }
    if (string == nil) {
        return YES;
    }

    if (string.length == 0) {
        return YES;
    }

    if ([string isEqualToString:@"<null>"]) {
        return YES;
    }

    if ([string isEqualToString:@"(null)"]) {
        return YES;
    }

    return NO;
}

